<?php
/* Constract The Slideshow */
function wpboxes_homepage_slideshow() { ?>
<div id="slideshow">
	<ul class="bjqs">
	<?php global $post;
		$args = array('numberposts' => wpboxes_options('wpboxes_nsp'), 'category' => wpboxes_options('wpboxes_fpc'));
			$posts = get_posts($args);
				foreach($posts as $post) : setup_postdata($post); ?>

				<li>
					<a href="<?php the_permalink(); ?>"><img src="<?php echo wpboxes_featured_image(); ?>" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" width="730" height="300" ></a>
				</li>
				
<?php endforeach; ?>
</ul>
</div>
<?php }

/* Initiate Slideshow */
function wpboxes_slider() {
	if (is_home()) { ?>
	
	<script type="text/javascript">
        jQuery(document).ready(function($) {
          
          $('#slideshow').bjqs({
            animtype      : 'slide',
            height        : 300,
            width         : 730,
            responsive    : true,
            randomstart   : true,
			nexttext	  : '<img src="<?php echo get_template_directory_uri();?>/images/ra.png" />',
			prevtext	  : '<img src="<?php echo get_template_directory_uri();?>/images/la.png" />'
          });
          
        });
	</script>
<?php }
}
add_action ('wp_footer', 'wpboxes_slider'); 
?>